<?php require_once("src/index_cs.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Autenticación</title>
<link href="style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

</head>

<body class="style" onload="MM_preloadImages('images/menu3.png','images/menu2.png')">

<div id="container">
  <div id="header">
    <table width="100%" border="0" cellspacing="0" cellpadding="8">
      <tr>
        <td width="50%" align="left" ><div style="margin-left:200px"><img src="images/nacr.jpg" width="294" height="150" /></div></td>
        <td width="50%" align="right"></td>
      </tr>
    </table>
    <!-- end #header -->
  </div>
  <div id="mainContent">  
    
    <div id="bg1">
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
	  <form name="formIndex" id="formIndex" method="post" action="">
	  <input type="hidden" name="agregar" id="agregar" value="1"/>
      <table width="630px" height="212px" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left" valign="center">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="images/bgup1.jpg" width="630" height="8" /></td>
      </tr>
      <tr>
        <td align="center" valign="top" background="images/bga.jpg"><table width="600px" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td><table width="124px" height="20px" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="center" background="images/tittle.png"><table width="96%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="center" class="EstiloRojo">INICIAR SESIÓN</td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><img src="images/up.jpg" width="600" height="7" /></td>
          </tr>
          <tr>
            <td background="images/midle.jpg"><form name="form" id="form" method="post" action="">
<input type="hidden" name="add" id="add" value="1"/>
<table width="80%" border="0" align="center" background="images/table1.jpg">
  <tr>
      <td width="333" ><div align="right"><strong>USUARIO</strong></div></td>
      <td width="439" align="left" valign="middle" >
          <label>
          <input name="login" id="login" type="text" class="style2" size="30" maxlength="50" />
          </label></td>
    </tr>
    <tr>
      <td width="333" height="53"><div align="right"><strong>CONTRASEÑA</strong></div></td>
      <td width="439" align="left" valign="middle" >
          <label>
          <input name="password" id="password" type="password" class="style2" size="30" maxlength="50" onKeyPress="return enter(event)"/>
          </label>      </td>
    </tr>
	<?php if(@$showCatpcha == 1){?>
    
	<tr>
      <td width="333" height="53"><div align="right"><strong>IMAGEN DE SEGURIDAD</strong></div></td>
      <td width="439" align="left" valign="middle" >
         <label>
          <img src="includes/generar_imagen_seguridad.php" align="absmiddle" /></label></td>
    </tr>
	
	<tr>
      <td width="333" height="53"><div align="right"><strong>ESCRIBA EL CODIGO</strong></div></td>
      <td width="439" align="left" valign="middle" >
          <label>
          <input name="letraVal" type="text" class="caja" maxlength="6" onKeyPress="return enter(event)" size="30">
          </label>      </td>
    </tr>
	
    
	<?php }?>
  <tr>
 
    <td colspan="3" align="center"> 
		<input name="guardar" type="button" class="boton_crear" value="Aceptar" onclick="javascript: return validar();"/>
        <input name="borrar" type="reset" class="boton_crear" value="Limpiar" /></td>
  </tr>
  <tr>
    <td >&nbsp;</td>
    <td >&nbsp;</td>
  </tr>
  <tr>
   <td >&nbsp;</td>
   <td >&nbsp;</td>

  </tr>
</table>
</form></td>
          </tr>
          <tr>
            <td><img src="images/down.jpg" width="600" height="5" /></td>
          </tr>
        </table>
          <br />
          <br /></td>
      </tr>
      <tr>
        <td><img src="images/bgdown.jpg" width="630" height="8" /></td>
      </tr>
    </table></td>
  </tr>
</table>
	  </form>
    </div>
    <br />
    <br />
    <!-- end #mainContent -->
  </div>

<!-- end #container --></div>

</body>
</html>
<script language="javascript" type="text/javascript" >
function validar(){
	f = window.document.formIndex;
	
	var msj = '';
	
	if(document.getElementById("login").value == "")
		msj = "El campo usuario es obligatorio \n";
	
	if(document.getElementById("password").value == "")
		msj = msj+"El campo contrase\u00F1a es obligatorio";
	
	if(msj != '')
	{
		alert(msj);
		return false;
	}
	else
	{
		f.submit();		
		return true;
	}
}

function enter(event) 
{  
	var enterCodigo = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;   
	  
	// Si se presionó la tecla Enter se ejecuta   
	if (enterCodigo == 13) 
	{ 
		validar();
	}
}

</script>
